<?php

namespace App\Http\Middleware;

use Closure;
use App\Models\Shop\Customer;

class LoginMiddleware
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {

        if(!session()->has('customer')) {

            $customer= Customer::find('34');
            //dump($customer);
            session()->put('customer', $customer);
            //session('customer', $customer);
            //dump(session()->all());
        //return $customer;
        }
        return $next($request);
    }
}
